home *** CD-ROM | disk | FTP | other *** search
/ PC User 2002 July / Disc 2 / PCU0702CD2.iso / magstuff / retro / files / ztw149.exe / TFC.TXT < prev    next >
Encoding:
Text File  |  2001-12-19  |  18.8 KB  |  441 lines

  1.  
  2.  
  3.                          Tadzio's File Compare
  4.                          =====================
  5.  
  6.                                Version 2.21a
  7.  
  8.                (c) 1997-1999 Daniel Schroeder (tadzio@tadzio.com)
  9.  
  10.  
  11. For a list of changes since the last version see "10. Version History"
  12. at the end of this document!
  13.  
  14.  
  15. 0. Contents
  16. -----------
  17.  
  18.  1. What is it?
  19.  2. It's free!
  20.  3. Legal stuff
  21.  4. Command line options
  22.  5. Interactive usage
  23.  6. What does 'Tadzio' stand for?
  24.  7. Known bugs and problems
  25.  8. Future plans
  26.  9. Getting the latest version
  27. 10. Version history
  28. 11. Contacting the author
  29.  
  30.  
  31.  
  32. 1. What is it?
  33. --------------
  34.  
  35. Tadzio's File Compare (or tfc) is a small and fast side-by-side file compare
  36. utility for Windows 9x and NT. It takes two file names from the command line
  37. (or one file name and one directory, or some wildcards - see below) and
  38. displays them side-by-side in a console window, highlighting differing
  39. lines. Tfc employs a sophisticated resync mechanism to find matching portions
  40. of the two files. It will allow you two scroll through the two files, modify
  41. comparison criteria like case sensitivity or ignoring empty lines, and jump
  42. directly to the next or previous difference.
  43.  
  44. You may use it, for example, to compare your CONFIG.SYS to CONFIG.BAK to find
  45. out what that install routine you just ran did to your CONFIG.SYS.
  46.  
  47. Tfc was modelled after "Jeff's file compare" which was included in later
  48. versions of XTree, but has an improved resync mechanism and a better user
  49. interface. It was designed to be used both as a stand-alone program and a
  50. plug-in for Kim Henkel's great XTree clone ZTree Win (available at 
  51. www.ztree.com; starting with version 1.30, ZTree Win distribution archives
  52. include tfc).
  53.  
  54. Note: Tfc treats any single Carriage Return (CR), single Line Feed (LF), and
  55. CR/LF combination as end-of-line character. It does not differentiate between
  56. them which means that tfc treats files that differ only in their end-of-line
  57. character as identical. 
  58.  
  59.  
  60. 2. It's free!
  61. -------------
  62.  
  63. That's right - it will cost you nothing! If you like it and still feel
  64. you want to give someone some money, I'd be very happy if you'd make a
  65. donation to any AIDS charity organisation.
  66.  
  67. Oh, and as I'm the curious type, I'd appreciate you sending an e-mail to
  68. tadzio@tadzio.com (that's me :-)) if you use it regularly. Thanks!
  69.  
  70.  
  71.  
  72.  
  73. 3. Legal stuff
  74. --------------
  75.  
  76. Copyright:
  77.  
  78. Tfc is copyrighted material. That means you must not do things to tfc I didn't
  79. allow you. Especially, don't sell it (give it away for free instead), don't
  80. alter or disassemble it.
  81.  
  82. In former versions, I didn't allow tfc to be used in miltary environment.
  83. After an intense e-mail discussion, I now dropped this restriction. 
  84. Instead, please read the HOWTO.TXT file in this archive.
  85.  
  86.  
  87. Warranty:
  88.  
  89. Basically, "you get what you pay for." So there's no warranty at all. I will
  90. not be liable for any damage, loss of profit or other consequences arising out
  91. of the use of Tadzio's File Compare utility.
  92. That said, I can assure you I did my best as a professional programmer to make
  93. tfc as safe as I could. Both files to be compared are opened in read-only mode
  94. and closed again as soon as they are read into memory. Tfc never attempts to
  95. write to your hard disk (except for its configuration file, tfc.ini, and maybe
  96. triggering Windows' memory swapping mechanism if you compare very large files),
  97. so it's highly unlikely that anything on your hard disk gets corrupted.
  98. Also, tfc knows nothing about MAPI or TCP/IP, so it will never send any
  99. information to anyone over a network.
  100.  
  101.  
  102.  
  103.  
  104. 4. Command line options
  105. -----------------------
  106.  
  107.                  tfc [-options] file1 [file2]
  108.  
  109. [] denote optional parts.
  110.  
  111. file1: Any valid file name, with or without path. Long file names are
  112.   supported. If it contains blanks, surround it with double quotes.
  113.   You can not use wildcards ('*' and '?') here.
  114.  
  115. file2: Either a file name or a directory or nothing. If you do not specify
  116.   file2, tfc assumes the same name as file1, with the extension changed
  117.   to '.bak'.
  118.   If you specify a directory, tfc will append the name and extension portion
  119.   (omitting the drive and directory parts, if any) of file1 to it. You may
  120.   specify the directory with or without a trailing backslash.
  121.   You may replace the name and/or extension portion of file2 with an asterisk.
  122.   In that case, the corresponding part of file1 is used in place of that
  123.   wild card. The question mark wild card '?' is not supported.
  124.  
  125. Examples: this command line      |  compares file     |     to file
  126. -----------------------------------------------------------------------------
  127.  tfc c:\config.sys               |  c:\config.sys     | c:\config.bak
  128.  tfc c:\config.sys  c:\backup    |  c:\config.sys     | c:\backup  (see Note)
  129.                                  |                    | c:\backup\config.sys
  130.  tfc c:\config.sys  *.old        |  c:\config.sys     | c:\config.old
  131.  tfc c:\config.sys  d:\aaa\*.old |  c:\config.sys     | d:\aaa\config.old
  132.  tfc autoexec.bat   4start.*     |  autoexec.bat      | 4start.bat
  133.  tfc "Letter to Diane"           |  "Letter to Diane" | "Letter to Rosie"
  134.              "Letter to Rosie"   |                    |
  135.  
  136. Note: If c:\backup exists; if not, tfc tries c:\backup\config.sys instead.
  137. ------------------------------------------------------------------------------
  138.  
  139.  
  140. Options:
  141.  
  142. -aXX: Set window height to XX lines. XX must be at least 12. The upper limit
  143.   depends on the operating system. This actually sets the "Window Buffer Size".
  144.   If this is lower than your DOS box's "Window Height", Windows will reduce
  145.   the "Window Height" accordingly. However, if you set XX to a higer value
  146.   than "Window Height", Windows will merely add a vertical scroll bar, but not
  147.   enlarge the DOS box itself. ("Window Height" and "Window Buffer Size" can
  148.   be changed in the "Layout" tab of a DOS box's properties.)
  149.   By the way: in case you wondered why I chose "-a" for this option: I just ran
  150.   out of more meaningful letters...
  151.  
  152. -b: Batch mode. The two files are compared, a one-line-info is printed ("The
  153.   file are identical" or "The files are not identical"), and tfc exits with
  154.   one of the following error levels:
  155.   0: files are identical
  156.   1: files are not identical
  157.   2: one of the files could not be found or opened
  158.   3: out of memory (though I'm not sure if this will ever happen under Win32)
  159.   This option is meant for using tfc in batch files, e.g. for synchronising
  160.   directories or automatically checking if a file has changed before backing it
  161.   up.
  162.  
  163. -c: Case insensitive compare. By default, tfc treats upper case and lower case
  164.   characters as different. This option treats German umlauts correctly!
  165.  
  166. -d: Toggles highlighting of differing characters within a line on or off.
  167.   Turning this on may slow down tfc a bit, and may make for a confusing display
  168.   if lines are totally different, so that characters will only randomly match.
  169.  
  170. -e: Suppress empty lines. All lines that contain only whitespace
  171.   characters (blanks, tabs) are ignored during compare and display.
  172.  
  173. -h: Toggles between hex and ASCII mode. The toggle affects the compare
  174.   routines as well as the display routines. In hex mode, every line contains
  175.   as many characters as can be displayed at this moment.
  176.   Note that as of version 2.20, tfc will *not* try to resync files in hex
  177.   mode, as most users seem to use it for files where some bytes were *changed*,
  178.   but not inserted or deleted. This is experimental - if you don't like it,
  179.   let me know, and I'll make it configurable!
  180.  
  181. -l: No line numbers are displayed.
  182.  
  183. -n: Same as -l, for compatibility with JFC
  184.  
  185. -o: Toggles between OEM and ANSI character sets. OEM (or ASCII) is used by
  186.   DOS-based programs, whereas Windows-based programs use ANSI.
  187.  
  188. -s: Sync scan +500 lines. If tfc finds two lines to be different, it assumes
  189.   some lines were inserted in one of the files, and the matching line is some-
  190.   where further down in the file. So by default it scans the next 100 lines
  191.   to find it ("resync"). If you compare files of which you know that more than
  192.   100 lines were inserted somewhere, you may want to use this option. However,
  193.   this may slow down tfc considerably.
  194.  
  195. -v: Start with a vertically split display. The default is a horizontally split
  196.   display (new for 2.1)
  197.  
  198. -w: Compress white space. All sequences of one or more whitespace characters
  199.   are treated as one single blank character during compare and display. This
  200.   makes it possible to compare two versions of a file where one version has
  201.   tabs, and some editor changed those tabs to a series of blanks in the second
  202.   version.
  203.  
  204.  
  205.  
  206.  
  207. 5. Interactive usage
  208. --------------------
  209.  
  210. By default, tfc displays the two file on a horizontally split
  211. screen. The colors are taken from tfc.ini, if it can be found in the
  212. directory where tfc.exe lives; otherwise, tfc tries to read the colors
  213. from ZTW.INI. If that also fails, default colors are used. There is a
  214. color setup utility built into tfc (try pressing Alt-F10) that creates
  215. tfc.ini.
  216.  
  217. If the files to compare are identical, tfc tells you so, waits for a key 
  218. stroke (not in batch mode) and exits.
  219.  
  220. The usual cursor keys can be used to navigate through the two files. They work
  221. like in any other program, with one additional feature: If you scrolled the
  222. display to the right, Pos1 (Home) does not jump to the beginning of the files,
  223. but rather to the beginning of the line. If you press it again, tfc then 
  224. will jump to the beginning of the files.
  225.  
  226. '+' and '-' jump to the next and previous block of different lines,
  227. respectively. If there is no such block, they jump to the end resp. beginning
  228. of the files. The space bar functions identically to '+'.
  229.  
  230. 's' toggles between horizontal and vertical splitting of the screen.
  231.  
  232. 'h' toggles between hex and ASCII mode. The toggle affects the compare
  233. routines as well as the display routines. In hex mode, every line contains
  234. either eight (vertical-split) or 16 (horizontal-split) characters.
  235. The line number display changes to a file-offset display, using hexadecimal
  236. numbers.
  237.  
  238. 'l' (thats an ell) toggles line numbers on and off - for those of you who want
  239. to see more of the files and are not interested in line numbers. For
  240. compatibility with jfc, 'n' is also accepted. In hex mode, the line number
  241. display changes to a file offset hex display that cannot be switched off.
  242.  
  243. 't' toggles between 25 lines and x lines display, where x is either 50 (if tfc
  244. was started in 25-lines-mode) or the number of lines of the active mode when
  245. tfc was started (otherwise). Regardless of the state of this toggle, when
  246. exiting tfc always switches back to the mode that was active when tfc was
  247. started.
  248.  
  249. '1'...'9' sets the display width of tab characters. Note that this does NOT
  250. have any impact on the compare operation, only on the display!
  251.  
  252. 'c' toggles between case sensitive compare (the default) and case-insensitive
  253. compare. The case-insensitive setting handles German umlauts correctly!
  254.  
  255. 'o' toggles between OEM and ANSI character sets. OEM (or ASCII) is used by
  256. DOS-based programs, whereas Windows-based programs use ANSI.
  257.  
  258. 'w' toggles white space compression on and off. If on, all sequences of
  259. whitespace characters (blanks, tabs) in the two files are replaced by one
  260. single blank. This affects the compare operation as well as the display.
  261.  
  262. 'e' toggles empty line suppression on and off. If on, all lines that contain
  263. nothing but blanks and/or tabs are ignored.
  264.  
  265. F1 gives you access to the online help, although I feel tfc is so easy and
  266. intuitive to use that the online help shouldn't be really necessary.
  267.  
  268. Alt-F10 invokes the color setup facility, see below.
  269.  
  270. ESC and ENTER both exit tfc.
  271.  
  272.  
  273.  
  274.  
  275. 5a. Color Setup
  276. ---------------
  277.  
  278. There is a built-in color setup facility that can be invoked by
  279. pressing Alt-F10.
  280.  
  281. The color setup facility allows you to customize tfc's color scheme.
  282. The colors are stored in a file named tfc.ini in the same directory as
  283. tfc.exe (which may be different from the current directory!)
  284.  
  285. The color setup screen shows two sample files which contain elements of all
  286. possible colors. Note that during 'real' usage you need to toggle 'Diff chars'
  287. on to see the 'Differing chars in differing line' color.
  288.  
  289. To change a foreground color, use uppercase letters, e.g. Shift-f or Shift-i.
  290. To change background colors, just use the indicated letters, e.g. 'f' or 'i'.
  291. The meaning of 'f', 'i', and 'l' should be rather self-explanatory.
  292. 'm' and 'd' are for characters in lines that differ between the two files.
  293. 'r' restores a built-in default color scheme - in case you got totally
  294. lost. 'k' deletes the file 'tfc.ini' from disk. If you called tfc from
  295. within ZTree, tfc reverts back to ZTree's color scheme. Otherwise, tfc uses
  296. its default scheme. By pressing ESC, all changes (except deleting tfc.ini)
  297. will be discarded. ENTER on the other hand writes the current color scheme to
  298. tfc.ini, regardless of how the color scheme was created (inherited by ZTree,
  299. 'R'estored, etc).
  300. Note that if you want tfc to inherit ZTree's color scheme each time you use
  301. it, you'll have to first 'k'ill tfc.ini, then press ESC - do NOT press ENTER,
  302. as this would write a new tfc.ini, overriding ZTree's settings.
  303.  
  304.  
  305.  
  306.  
  307. 6. What does 'Tadzio' stand for?
  308. --------------------------------
  309.  
  310. Tadzio is a nick name for 'Tadaeusz', a common Eastern European name. I used
  311. it as a handle/nick ever since I bought my first modem. I even ran a BBS named
  312. 'Tadzio BBS' for several years.
  313.  
  314. Tadzio is one of the two main characters in Thomas Mann's novel "Tod in
  315. Venedig" ("Death in Venice"). It's about a German doctor named 
  316. "Aschenbach" who visits Venice in the early decades of this century. He sees
  317. Tadzio, the 16-year-old son of a polish baroness, and is absolutely fascinated
  318. of him. But society on the one hand and his moral education on the other make
  319. it impossible for him to even talk to Tadzio, although the boy noticed him.
  320. Aschenbach dies, superficially from the plague, but metaphorically from
  321. the conflict between his feelings and his education, and the unability to live
  322. by his feelings. That same conflict and the same feelings are also present in
  323. Thomas Mann's life.
  324.  
  325. There also is an excellent film by Luchino Visconti. And now back to the
  326. profanities of computer programs... :-)
  327.  
  328.  
  329.  
  330.  
  331. 7. Know bugs and problems
  332. -------------------------
  333.  
  334. If a tab character is scrolled out of the left side of an window, the
  335. remainder of that line jumps left to the window border. Fixing this would make
  336. tfc much slower, so I hope you can live with it...
  337. The performance for very large files allows you to feed your cat while waiting
  338. for tfc to display the files...
  339.  
  340.  
  341.  
  342. 8. Future plans
  343. ---------------
  344.  
  345. That depends largely on the feedback I get from you. So, if you like it, or
  346. if you have ideas for additional features, email me! I can be reached under
  347. tadzio@tadzio.com.
  348.  
  349.  
  350.  
  351. 9. Getting the latest version
  352. -----------------------------
  353.  
  354. The latest version will always be available at http://www.tadzio.com (this 
  355. site is in German, but you don't have to speak German. Just click on 'Home of
  356. tfc', then on 'Download', and there you go!).
  357. Alternatively, you can get it bundled with Kim Henkel's ZTreeWin from his site
  358. at http://www.ztree.com.
  359.  
  360.  
  361.  
  362.  
  363. 10. Version history
  364. ------------------
  365. 2.21a 1999-12-13 - Change: When window height is specified using -aXX,
  366.                    the previous state is *not* restored on exit. This
  367.                    should help ZTree users.
  368.                  - Change: back to old window height (more correctly:
  369.                    screen buffer height) detection method
  370.                  - Change: better error handling if a WinAPI call to
  371.                    change the screen buffer height fails.
  372. 2.21  1999-12-03 - Bugfix: When used stand-alone, tfc hides the cursor
  373.                    and would not re-enable it when exiting - fixed.
  374. 2.20  1999-11-28 - Bugfix: file names that included non-ASCII characters
  375.                    were inproperly parsed.
  376.                  - Change: In hex mode, tfc no longer tries to re-sync.
  377.                  - Change: In hex mode, the number of characters on one line
  378.                    is now set to 8 (vertical-split) or 16 (horizontal-split)
  379.                  - Change: In hex mode, a file offset is displayed instead of
  380.                    the line number.
  381.                  - Change: Changed the logic that determines the initial 
  382.                    window height.
  383.                  - Change: tfc is now compiled with MS Visual C++ 6.0, 
  384.                    resulting in a smaller executable file.
  385.                  - Change: Version history now uses standardized date 
  386.                    format ;-)
  387.  
  388. 2.13  6/6/1999   - New: Command line switch -aXX to set window height to XX
  389.                    lines.
  390.  
  391. 2.12  4/27/1999  - Bugfix: Command line switch -n was not documented
  392.                    at all, -v was missing in internal documentation.
  393.  
  394. 2.11  4/26/1999  - Bugfix: tfc incorrectly stated that two files were
  395.                    identical when the first n characters were identical,
  396.                    where n is the length of the first file, and the
  397.                    second file was longer than the first. 
  398.  
  399. 2.10  4/23/1999  - Bugfix: Cursor keys didn't work in Windows 9x when a
  400.                    keyboard driver was loaded in CONFIG.SYS. This is the
  401.                    case for all non-english versions of Windows. NT was
  402.                    not affected.
  403.                  - Change: The display is now split horizontally by default.
  404.                  - Added: New command line switch '/s' to start with a
  405.                    vertically split display, as pre-2.1 versions did.
  406.                  - Added: The color setup is now better documented.
  407.                  - Change: The restriction for usage in a military 
  408.                    environment was removed.
  409.  
  410. 2.02  2/21/1999  - Bugfix: Command line parameters ending in \" caused a
  411.                    "can't open file" error.
  412.                  - Documentation updates: New email address, own home page,
  413.                    changed tfc.doc to tfc.txt
  414.                  This version was never really released, because literally
  415.                  minutes before I wanted to upload it, someone discovered a
  416.                  serious bug. That's life!
  417.  
  418. 2.01  8/9/1997   - Bugfix: file names that contained special characters (um-
  419.                    lauts etc) weren't treated correctly
  420.                  - New: ANSI/OEM toggle
  421.  
  422. 2.0   8/2/1997   First Windows 95/NT version, based on the old OS/2 code,
  423.                  but many new features.
  424.  
  425. 1.0   9/2/1996   First public OS/2 version.
  426.  
  427.  
  428.  
  429. 11. Contacting the author
  430. ------------------------
  431.  
  432. If you have any comments, wishes, or encounter problems, please e-mail me.
  433. My e-mail address is
  434.  
  435.        tadzio@tadzio.com
  436.  
  437. Home Of TFC is http://www.tadzio.com. Here you can always get the latest
  438. version.
  439.  
  440. ---
  441.